function [num_new_branch_bangkok,num_new_branch_northern,num_new_branch_southern,num_new_branch_central,num_new_branch_northeastern]=...
    num_branch(comm_loc)
    
    load('region.mat');
    nyear=size(comm_loc,2);
    num_new_branch_bangkok(1:nyear-1,1)=0;
    num_new_branch_northern(1:nyear-1,1)=0;
    num_new_branch_southern(1:nyear-1,1)=0;
    num_new_branch_central(1:nyear-1,1)=0;
    num_new_branch_northeastern(1:nyear-1,1)=0;
    for i=1:nyear-1
        new_branch_model=find(comm_loc(:,i)==0 & comm_loc(:,i+1)==1);
        num_new_branch_bangkok(i)=length(intersect(index_bangkok,new_branch_model));
        num_new_branch_northern(i)=length(intersect(index_northern,new_branch_model));
        num_new_branch_southern(i)=length(intersect(index_southern,new_branch_model));
        num_new_branch_central(i)=length(intersect(index_central,new_branch_model));
        num_new_branch_northeastern(i)=length(intersect(index_northeastern,new_branch_model));
    end
    num_new_branch_bangkok=[num_new_branch_bangkok;sum(num_new_branch_bangkok)];
    num_new_branch_northern=[num_new_branch_northern;sum(num_new_branch_northern)];
    num_new_branch_southern=[num_new_branch_southern;sum(num_new_branch_southern)];
    num_new_branch_central=[num_new_branch_central;sum(num_new_branch_central)];
    num_new_branch_northeastern=[num_new_branch_northeastern;sum(num_new_branch_northeastern)];

end